package br.com.playonline.rest.teste;

import java.util.ArrayList;
import java.util.List;

import org.springframework.web.client.RestTemplate;

import br.com.playonline.dto.CarrinhoConverterList;
import br.com.playonline.dto.CarrinhoDTO;

public class CarrinhoTeste {

	public static String URI_SERVER = "http://localhost:8080/restservice";
	
	public static void main(String[] args) {
		incluirCarrinho();
	}

	public static void incluirCarrinho() {
		List<CarrinhoDTO> carrinhos = new ArrayList<CarrinhoDTO>();
		CarrinhoDTO carrinho = new CarrinhoDTO();
		carrinho.setId(new Long(1));
		carrinhos.add(carrinho);
		CarrinhoConverterList carrinhoConverterList = new CarrinhoConverterList();
		carrinhoConverterList.setCarrinhoDTOs(carrinhos);
		
		System.out.println(carrinhoConverterList.getCarrinhoDTOs().size());
//		CarrinhoAdicionarBolaoDTO adicionarBolaoDTO = new CarrinhoAdicionarBolaoDTO();
		
		RestTemplate restTemplate = new RestTemplate();
		restTemplate.postForLocation(URI_SERVER + "/carrinho/add", carrinhoConverterList, CarrinhoConverterList.class);
		
	}
	
}
